frequencyTableIntervals <-
function(x,breaks = "Sturges"){
h<-hist(x,breaks,plot=FALSE)
t<-as.data.frame(table(cut(x,breaks=h$breaks)))
ni<-t$Freq
n<-sum(ni)
fi<-ni/n
Ni<-cumsum(ni)
Fi<-Ni/n
nc<-length(ni)
z<-rep(0,5*nc)
dim(z)<-c(nc,5)
z[,1]<-h$mids
z[,2]<-ni
z[,3]<-fi
z[,4]<-Ni
z[,5]<-Fi
colnames(z)<-c("Marca","Freq.Abs.","Freq.Rel.","Freq.Abs.Acum.","Freq.Rel.Acum.")
rownames(z)<-t$Var1
return(z)
}

